package com.budweiser.budweisermain.controller;

import com.budweiser.budweisermain.service.NavMenuService;
import com.budweiser.model.result.ResponseBase;
import com.budweiser.model.system.menu.result.GroupMenu;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;

@RestController
public class MenuController {

    @Autowired
    private NavMenuService navMenuService;

    @PostMapping("/find_all_menu")
    @PreAuthorize("")
    public ResponseBase findAllNavMenu() {
        List<GroupMenu> groupMenuList = navMenuService.findAllNavMenu();
        return new ResponseBase(0, "success", groupMenuList);
    }
}
